﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LoadingList.aspx.cs"
    Inherits="WMS6.Web.Outbound.LoadingList" %>

<%@ PreviousPageType VirtualPath="~/Outbound/LoadingQuery.aspx" %>
<%@ Register Src="../UserControls/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>LoadHeaderList</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />

    <script src="../Js/jquery.js" type="text/javascript"></script>

    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>

    <script src="../Js/util.js" id="js" type="text/javascript"></script>

    <script src="../Js/InitPage.js" type="text/javascript"></script>

    <script src="../Js/checkbox.js" type="text/javascript"></script>

    <base target="_self" />

    <script type="text/javascript">
        //初始化页面
        window.onload = function() {

            var action = document.getElementById("hdnActionID").value;
            if (action != null && action != "") {
                var array = action.split(',');
                initQueryPage(array[0], array[1]);
            }
            else {
                initListPage();
            }
        }
        function returnSearch()
        {
            var from = document.getElementById("hdnFrom").value;
            if(from != "")
            {
                window.location.href = "LoadingQuery.aspx";
            }
            else
            {
                window.history.go(-1);
            }
        }
        function confirmMsg(code)
        {
            if(code == "C001")
            {
                if(confirm('<%=GetGlobalMsgResource("C001") %>'))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }

        }
        function showAction()
		{	
			var pos = getElementPos("btnAction");	
			document.getElementById("actionDiv").style.top = pos.y+17;
			document.getElementById("actionDiv").style.left = pos.x;  			
			document.getElementById("hiddenFlag").value = '1';
		}
		  function hiddenDiv()
		  {
			var flag = document.getElementById("hiddenFlag").value
			if(flag == "1")
			{
				document.getElementById("actionDiv").style.display = "block";
				document.getElementById("hiddenFlag").value = '0';
			}
			else 
			{
				document.getElementById("actionDiv").style.display = "none";
			}
		  }
		  //锁屏
		function blockScreen()
		{
		    //锁屏
		    $.blockUI.defaults.message = GetBlockUIMsg();
            $.blockUI.defaults.overlayCSS.backgroundColor = GetBlockUIBgColor();
            $.blockUI();
		}
    </script>

</head>
<body>
    <form id="F7057" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_List_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblLoadHeader" runat="server" CssClass="label_header" Text="装车单" meta:resourcekey="lblLoadHeader"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnNew" runat="server" CssClass="button" Enabled="true" Text="<%$ Resources:ButtonResource,btnNew %>"
                            OnClientClick="javascript:window.location.href='Loading.aspx?from=list';return false;" />
                    </td>
                    <td>
                        <asp:Button ID="btnEdit" runat="server" CssClass="button" Enabled="true" Text="<%$ Resources:ButtonResource,btnEdit %>"
                            OnClick="btnEdit_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnDelete" runat="server" CssClass="button" Enabled="true" Text="<%$ Resources:ButtonResource,btnDelete %>"
                            OnClick="btnDelete_Click" OnClientClick="javascript:if(confirmMsg('C001')) return true; else return false;" />
                    </td>
                    <td>
                        <input id="btnAction" type="button" runat="server" value="<%$Resources:ButtonResource,btnAction%>"
                            class="button" onclick="showAction();" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="blank8">
        </div>
        <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
                <div id="div_List">
                    <div id="div_List_msg">
                        <asp:Label ID="lblMsg" runat="server" CssClass="label_message" meta:resourcekey="lblMsg"></asp:Label>
                    </div>
                    <asp:GridView ID="gvLoadHeader" runat="server" AutoGenerateColumns="False" AllowSorting="True"
                        CssClass="gridview" OnRowDataBound="gvLoadHeader_RowDataBound" OnInit="gvLoadHeader_Init"
                        OnSorting="gvLoadHeader_Sorting" DataKeyNames="LOAD_ID,STATUS" PageSize="20"
                        Width="1350px">
                        <FooterStyle CssClass="GridViewFooterStyle" />
                        <RowStyle CssClass="GridViewRowStyle" />
                        <HeaderStyle CssClass="GridViewHeaderStyle" />
                        <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                        <Columns>
                            <asp:BoundField HeaderText="序号" FooterText="序号" meta:resourcekey="No">
                                <ItemStyle CssClass="GridViewRowWidth_40" />
                            </asp:BoundField>
                            <asp:TemplateField meta:resourcekey="TemplateFieldResource1">
                                <HeaderTemplate>
                                    <img src="../Images/gvSettingpic.gif" id="img01" class="gvSettingImg" onclick="gvUserSetting('7057','gvLoadHeader');"
                                        onmouseover="showGVUserSettingAlt(this);" alt="customize list" />
                                    <asp:CheckBox ID="CheckBox1" runat="server" onclick="selectAll(this,'gvLoadHeader');"
                                        meta:resourcekey="CheckBox1Resource1" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chbSelect" runat="server" meta:resourcekey="chbSelectResource1" />
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this,'gvLoadHeader');"
                                        meta:resourcekey="CheckBox2Resource1" />
                                </FooterTemplate>
                                <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                                <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="装车单号" FooterText="装车单号" SortExpression="LOAD_ID" meta:resourcekey="LOAD_ID">
                                <ItemTemplate>
                                    <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("LOAD_ID") %>' NavigateUrl='<%# FormatUrl("~/Outbound/Loading.aspx?from=list&ID={0}",Eval("LOAD_ID").ToString()) %>'
                                        Target="_self" CssClass="hyperlink"></asp:HyperLink>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="EXTERNAL_ID" HeaderText="外部装车单号" FooterText="外部装车单号" SortExpression="EXTERNAL_ID"
                                meta:resourcekey="EXTERNAL_ID">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="STATUS_D" HeaderText="状态" FooterText="状态" SortExpression="STATUS_D"
                                meta:resourcekey="STATUS_D">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:TemplateField FooterText="发车日期" HeaderText="发车日期" SortExpression="DEPARTURE_TIME"
                                meta:resourcekey="DEPARTURE_TIME">
                                <ItemTemplate>
                                    <asp:Label ID="lblDEPARTURE_TIME" runat="server" Text='<%# GetPreferenceShortDate(Eval("DEPARTURE_TIME").ToString()) %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_200" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="CARRIER_ID" HeaderText="承运商" FooterText="承运商" SortExpression="CARRIER_ID"
                                meta:resourcekey="CARRIER_ID">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="VEHICLE_NUMBER" HeaderText="车牌号" FooterText="车牌号" SortExpression="VEHICLE_NUMBER"
                                meta:resourcekey="VEHICLE_NUMBER">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="ROUTE" HeaderText="路线" FooterText="路线" SortExpression="ROUTE"
                                meta:resourcekey="ROUTE">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DOOR" HeaderText="门" FooterText="门" SortExpression="DOOR"
                                meta:resourcekey="DOOR">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:BoundField DataField="CREATED_BY" HeaderText="创建人" FooterText="创建人" SortExpression="CREATED_BY"
                                meta:resourcekey="CREATED_BY">
                                <ItemStyle CssClass="GridViewRowWidth_100" />
                            </asp:BoundField>
                            <asp:TemplateField FooterText="创建日期" HeaderText="创建日期" SortExpression="CREATED_DATE"
                                meta:resourcekey="CREATED_DATE">
                                <ItemTemplate>
                                    <asp:Label ID="lblCREATED_DATE" runat="server" Text='<%# GetPreferenceShortDate(Eval("CREATED_DATE").ToString()) %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="GridViewRowWidth_200" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </div>
                <div id="div_pager">
                    <uc1:Pager ID="PagerFooter" runat="server" OnFirst="btnFirst_Click" OnPrevious="btnPrevious_Click"
                        OnNext="btnNext_Click" OnLast="btnLast_Click" OnGoTo="GoTo_Click" />
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
        <div id="div_List_bottom">
            <table>
                <tr>
                    <td>
                        <asp:Button ID="btnNewSearch" runat="server" Text="<%$ Resources:ButtonResource,btnNewSearch %>"
                            Enabled="true" CssClass="button" OnClientClick="javascript:window.location.href='LoadingQuery.aspx';return false;" />
                    </td>
                    <td>
                        <asp:Button ID="btnReSearch" runat="server" Text="<%$ Resources:ButtonResource,btnReSearch %>"
                            Enabled="true" CssClass="button" OnClientClick="javascript:returnSearch();return false;" />
                    </td>
                    <td>
                        <asp:Button ID="btnList" runat="server" Text="<%$ Resources:ButtonResource,btnList %>"
                            Enabled="true" CssClass="button" OnClick="btnList_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnExport" runat="server" Text="<%$ Resources:ButtonResource,btnExport %>"
                            Enabled="true" CssClass="button" OnClick="btnExport_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <div id="actionDiv" style="background-color: #FFFFFF; position: absolute; display: none;
            border: none 0 black">
            <table width="105" border="0" cellspacing="0" cellpadding="0" id="divcontent_menu">
                <tr class="bg2" onmouseover="this.className='bg1'" onmouseout="this.className='bg2'">
                    <td class="line" id="tdlnkbtnClose" runat="server" visible="true">
                        <asp:LinkButton ID="lnkbtnClose" runat="server" Text="关闭" OnClientClick="blockScreen();"
                            OnClick="lnkbtnClose_Click" meta:resourcekey="lnkbtnClose"></asp:LinkButton>
                    </td>
                </tr>
                <tr class="bg2" onmouseover="this.className='bg1'" onmouseout="this.className='bg2'">
                    <td class="line" id="tdlnkbtnShipping" runat="server" visible="true">
                        <asp:LinkButton ID="lnkbtnShipping" runat="server" Text="发货" OnClientClick="blockScreen();"
                            OnClick="lnkbtnShipping_Click" meta:resourcekey="lnkbtnShipping"></asp:LinkButton>
                    </td>
                </tr>
                <tr class="bg2" onmouseover="this.className='bg1'" onmouseout="this.className='bg2'">
                    <td class="line" id="tdlnkbtnServed" runat="server" visible="true">
                        <asp:LinkButton ID="lnkbtnServed" runat="server" Text="送达" OnClientClick="blockScreen();"
                            OnClick="lnkbtnServed_Click" meta:resourcekey="lnkbtnServed"></asp:LinkButton>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <input id="hdnLoadID" runat="server" type="hidden" />
    <input id="hdnFlag" runat="server" type="hidden" value="0" />
    <input type="hidden" id="hdnFrom" runat="server" />
    <input type="hidden" id="hdnActionID" runat="server" />
    <input id="hiddenFlag" runat="server" type="hidden" />
    </form>
</body>
</html>

<script language="javascript" type="text/javascript" event="onclick" for="document">
		hiddenDiv();
</script>

